%  Copyright (C) 2002 Regents of the University of Michigan, portions used with permission 
%  For more information, see http://csem.engin.umich.edu/tools/swmf
\section{The Ionosphere}

The \BATSRUS\ code is capable of using an inner boundary condition
which is similar to the ionosphere.  The field aligned currents near
the inner boundary are used to drive an ionospheric flow, which is
used as a lower boundary in the magnetosphere.

\begin{itemize}

\item
Currents are calculated from $\mathbf{\nabla \times B}$ at some
distance away from the inner boundary ({\tt rCurrents}).
Specifically, the code runs through all of the cells in the simulation
to determine whether the particular cell is the first cell (as
compared to it's neighbors) which is outside of {\tt rCurrents}.
This is in {\tt magnetosphere.f90}.

\item
The code determines whether the cell maps to the northern or southern
hemisphere by testing whether it maps to the northern hemisphere. It
stores the value of the full 3-D current as well as the location in
arrays.  This is in {\tt magnetosphere.f90}.

\item
If {\tt UseFullCurrents} is {\tt .false.}, the code determines the
magnetic field direction in the magnetosphere and takes a dot product
of the 3-D current and the field direction.  If not, the 

\end{itemize}
